require("string")local file = io.open("writetest.txt", "w+")function OnUartData(data)    if nil == file then        print("open file writetest.txt fail")    end    file:write("OnUartData from lua " .. data)    file:flush()    showdata("dfasdfsddfasda" .. data)end-- function OnNetworkData(addr,data,len)--     print(addr,data,len)--     print(len)--     print(data)--     -- showbuffer("recv network data: " .. data .. "\r\n")-- end-- function OnUdpData(addr,data,len)--     print(addr,data,len)--     -- showbuffer("recv data: ",data,"\r\n")-- end-- function OnNewClient(addr,port,sock)--     print(addr,port,sock)--     -- showbuffer("tcp connected: "--     -- ..addr.."\r\n"..port.."\r\n"..sock.."\r\n")-- end-- function OnClientLeave(addr,port,sock)--     print(addr,port,sock)--     -- showbuffer("tcp close: "--     --  ..addr.."\r\n"..port.."\r\n"..sock.."\r\n")-- end